package com.yjt.yjtrouting.modules.infoTxnLogMapping;

import java.util.Collection;
import java.util.Hashtable;

import javax.annotation.Resource;

import org.hibernate.criterion.MatchMode;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yjt.yjtrouting.common.bean.domain.InfoTxnLogMapping;
import com.yjt.yjtrouting.common.dao.InfoTxnLogMappingDao;

@Service(InfoTxnLogMappingService.BEAN_PACKAGE_NAME)
@Transactional(readOnly=true)
public class InfoTxnLogMappingService {

	public static final String BEAN_PACKAGE_NAME = "com.yjt.yjtrouting.modules.infoTxnLogMapping.InfoTxnLogMappingService";
	
	@Resource(name = InfoTxnLogMappingDao.BEAN_PACKAGE_NAME)
	private InfoTxnLogMappingDao infoTxnLogMappingDao;
	
	public Collection<InfoTxnLogMapping> getInfoTxnLogMappingColByReqMsgIds(String... reqMsgId) {
		Hashtable<String, Object> paramsTable = new Hashtable<String, Object>();
		if(null != reqMsgId && reqMsgId.length != 0){
			paramsTable.put("requestMsgIds", reqMsgId);
			infoTxnLogMappingDao.enableFilter("filterByInReqMsgId", paramsTable);
			paramsTable.clear();
		}
		InfoTxnLogMapping queryModel = new InfoTxnLogMapping();
		//queryModel.setRequestMsgId(reqMsgId);
		Collection<InfoTxnLogMapping> result = infoTxnLogMappingDao.getBeansByBean(queryModel, MatchMode.EXACT);
		infoTxnLogMappingDao.disableFilter("requestMsgIds");
		return result;
	}
}
